
import { request } from 'ngfe-request'


// 历史折扣配置 折扣配置列表
export function getDiscountList(params: any) {
  return request('/args', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'DiscountSVC',
        stdIntfcInd: 'query',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },

  })
}

// 新增折扣配置
export function addDiscountData(params: any) {
  return request('/add', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'DiscountSVC',
        stdIntfcInd: 'add',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },
  })
}

// 获取所有商户号
export function getMerNo(params: any) {
  return request('/listCustNo', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'QureyCustInfoSVC',
        stdIntfcInd: 'listCustNo',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      }
    },
  })
}

// 生效规则
export function effect(params: any) {
  return request('/effect', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'DiscountSVC',
        stdIntfcInd: 'effect',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },
  })
}

// 删除未生效规则
export function delNotEffectByCustNo(params: any) {
  return request('/delete', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'DiscountSVC',
        stdIntfcInd: 'delete',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },
  })
}